import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../actions';


export default function counter(state = 0, action) {

    //这个不能输出，难道console.log 被重写了？
    console.log('[reducers/counter.js] ->counter state:', state, 'action', action);

    switch (action.type) {
        case INCREMENT_COUNTER:
            return state + 1;
        case DECREMENT_COUNTER:
            return state - 1;
        default:
            return state;
    }
}


